<%@page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
<link type="text/css" rel="stylesheet"
	href="${ctx }/css/dlifestyle/admin.css" source="widget" />
<script src="${ctx}/js/controllers/system/app/AppEditController.js"
	type="text/javascript"></script>
<style>
select {
	padding-left: 18px;
	font-size: 10px;
	border-radius: 10px;
	background-image: none;
	border: 1px solid #E5E5E5;
	color: #8b8787;
}

a {
	text-decoration: none;
}

.btn_addPic {
	display: inline-block;
	position: relative;
	height: 39px;
	overflow: hidden;
	padding: 0 30px;
	border: 1px solid #EBEBEB;
	background: none repeat scroll 0 0 #F3F3F3;
	color: #999999;
	font: 14px/39px 'MicroSoft Yahei', 'Simhei';
	cursor: pointer;
	text-align: center;
}

.filePrew {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 140px;
	height: 39px;
	cursor: pointer;
	opacity: 0;
	filter: alpha(opacity : 0);
}
</style>

<script type="text/javascript">
	var ctx = '${ctx}';
	setCtx(ctx);
</script>

<section>
	<div style="height: 40px; line-height: 40px;">
		<div class="forword_area"></div>
		<div class="location">当前位置：${sessionScope.currcent_position}</div>
	</div>
	<hr>
	<div class="editTitle" style="margin-top: 8px;">
		<div style="height: 41px; width: 250px; float: left;">
			<img style="float: left; margin-left: 37px; margin-top: 9.5px;"
				src="${ctx}/images/new_edit.png" />
			<c:if test="${type == 1 }">
				<h4>新增APP信息</h4>
			</c:if>
			<c:if test="${type == 2 }">
				<h4>编辑APP信息</h4>
			</c:if>
		</div>
		<div>
			<a style="float: right; margin-right: 20px; margin-top: -2px;"
				title="关闭" onclick="cancel();"><img
				src="${ctx}/images/new_close.png" /></a>
		</div>
	</div>
	<form id="formId" runat="server">
		<div id="form" class="form" style="min-height: 350px;">
			<div class="itemEdit">
				<input id="appId" type="hidden" value="${app.id }"> <span
					class="col-sm-1 editlableEdit">版本号：</span>
				<div class="flEdit">
					<c:if test="${empty  app.id}">
						<input class="controlEdit" id="versionNo" value="${app.versionNo}"
							type="text" maxlength="20" class="text" placeholder="请输入版本号"
							style="width: 17%;">
					</c:if>
					<c:if test="${not empty  app.id}">
						<input class="controlEdit"
							style="background-color: #fff; width: 17%;" id="versionNo"
							value="${app.versionNo}" type="text" maxlength="20" class="text"
							placeholder="请输入版本号" disabled="disabled">
					</c:if>
					<em class="emStyle">*</em>
				</div>
			</div>
			<div class="itemEdit">
				<span class="col-sm-1 editlableEdit">类型：</span>
				<div class="flEdit">
					<select id="type" class="editform-control"
						style="height: 30px; width: 100px;">
						<option value="-1"
							<c:if test="${app.type == -1 }">selected="selected"</c:if>>类型</option>
						<option value="1"
							<c:if test="${app.type == 1 }">selected="selected"</c:if>>android</option>
						<option value="2"
							<c:if test="${app.type == 2 }">selected="selected"</c:if>>ios</option>
					</select> <em class="emStyle">*</em>
				</div>
			</div>
			<c:if test="${empty app.downloadUrl }">
				<div class="itemEditMap" style="height: 100px;">

					<span class="col-sm-1 editlableEditMap"
						style="height: 100px; line-height: 100px;">上传附件：</span>
					<div class="flEditMap">
						<%@include file="/views/common/uploader/uploaderlist.jsp"%>
						<br /> <input id="fileIds" type="hidden">
						<div id="down">
							<a href="javascript:void(0);" onclick="upload();"
								class="btn_addPic"><img width="21px;"
								src="${ctx}/images/uploader/addFile.png" /><span>文件上传</span> <input
								tabindex="3" class="filePrew"> </a>
						</div>
					</div>
				</div>
			</c:if>
			<c:if test="${not empty app.downloadUrl }">
				<div class="itemEditMap" style="height: 100px;">

					<span class="col-sm-1 editlableEditMap"
						style="height: 100px; line-height: 100px;">下载附件：</span>
					<div class="flEditMap" style="line-height: 100px;">
						<input id="fileIds" type="hidden"> <a
							style="font-style: italic; text-decoration: underline; color: #0E68EF;"
							onclick="downLoadFile('${sessionScope.image_logo}${app.downloadUrl }');">app下载</a>
					</div>
				</div>
			</c:if>
			<div class="editorDetail">内容：</div>
			<div style="height: auto; min-height: 261px;">
				<div id="ueditor">
					<!-- <textarea name="content" id="ideaContent" style="width:537px;height:100px;resize:none" class="itxt" maxlength="200" required></textarea> -->

					<!-- 加载编辑器的容器 -->
					<script id="container" type="text/plain">${app.updateContent }</script>
					<!-- 配置文件 -->
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.config.js"></script>
					<!-- 编辑器源码文件 -->
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.all.js"></script>
					<script type="text/javascript"
						src="${ctx }/js/lib/ueditor/ueditor.parse.js"></script>
					<!-- 实例化编辑器 -->
					<script type="text/javascript">
						var ue = UE.getEditor('container',{
							toolbars : [
								       	  ['fontfamily','fontsize', '|', 'blockquote', 'horizontal', '|', 'removeformat', '|', 'insertimage'],
								       	  ['bold', 'italic', 'underline', 'forecolor', 'backcolor', '|',
								       	   'justifyleft', 'justifycenter', 'justifyright', '|',
								       	   'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
								       	   'insertorderedlist', 'insertunorderedlist', '|',
								       	   'imagenone', 'imageleft', 'imageright', 'imagecenter','autotypeset','cleardoc','source'
								       	   ]
								       	],
							UEDITOR_HOME_URL: '${ctx}/js/lib/ueditor/',
							serverUrl: '${ctx}/fileHandler/upLoaderMergeForUeditor',
							imageUrlPrefix: '${sessionScope.image_logo}',
							imageActionName: 'uploadimage',
							imageFieldName: 'file',
							imageMaxSize: 1024000,
							imageAllowFiles: ['.png', '.jpg', '.jpeg', '.gif'],
							initialFrameHeight: 200,
							elementPathEnabled: false,
							retainOnlyLabelPasted:true,
							wordCount: false,
							/* sourceEditor: 'textarea', */
							insertorderedlist: {
								// 系统自带
								'decimal': '',     // '1,2,3...'
								'lower-alpha': '', // 'a,b,c...'
								'lower-roman': '', // 'i,ii,iii...'
								'upper-alpha': '', // 'A,B,C'
								'upper-roman': ''  // 'I,II,III...'
							},
							insertunorderedlist : {
								// 系统自带
								'circle': '',  // '○ 小圆圈'
								'disc': '',    // '● 小圆点'
								'square': ''   // '■ 小方块'
							},
							listDefaultPaddingLeft: '50'
						});
							</script>
				</div>
			</div>

			<div class="foot">
				<button class="buttonCancle" onclick="cancel();">取&nbsp;&nbsp;消</button>
				<button class="buttonEdit" onclick="saveOrUpdateApp();">保&nbsp;&nbsp;存</button>
			</div>
		</div>
	</form>
	<%@include file="/views/common/footer.jsp"%>
</section>

<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
